<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <style>
        thead tr th{text-align: center!important;}
        tr td{text-align: center!important;}
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-table" lay-filter="seckill-table" id="seckill-table"></table>
                    <script type="text/html" id="table-operate-tool">
                        <div class="layui-btn-container">
                            <button class="layui-btn layui-btn-warm" lay-event="toPrev">返回上一页</button>
                        </div>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script src="/js/common.js"></script>
<script>
    var seckillId = ${seckillId};
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table','form'], function(){
        var table = layui.table;
        table.render({
            elem:'#seckill-table',
            url:'/activity/querySeckillDetail?id='+seckillId,
            page:true,
            toolbar: '#table-operate-tool',
            request:{
                pageName:'current',
                limitName:'size'
            },
            cols:[[
                {field:'proCode',title:'商品编码',minWidth:200},
                {field:'proName',title:'商品名称',minWidth:240},
                {field:'specName',title:'规格名称',width:200},
                {field:'price',title:'商品原价',width:200},
                {field:'seckillPrice',title:'秒杀价',width:200,style:'color:red'},
                {field:'totalNum',title:'参与总数',width:180},
                {field:'limitNum',title:'每人限购数',width:180},
                {field:'sort',title:'排序',width:150}
            ]]
        });

        table.on('toolbar(seckill-table)', function(obj){
            if(obj.event === 'toPrev'){
                history.go(-1);
            }
        });
    });
</script>
</body>
</html>